package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class LambdaDemo02 {
    public static void main(String[] args) {
        Random random = new Random();
        List<Integer> list1 = new ArrayList<>();
        while (list1.size()<10){
            list1.add(random.nextInt(101));
        }
        Collections.sort(list1,((o1, o2) -> o2-o1));
//        Collections.reverse(list1);
        System.out.println(list1);

        String str1 = "\\w{8,10}";
        String str2 = "^\\w{8,10}$";
        String str = "abcd123412";

        if (str.matches(str1)){
            System.out.println("yes");
        }else {
            System.out.println("no");
        }

    }
}
